'''
Created on Sep 6, 2013

@author: loski07@gmail.com
'''

from controller.deviceManager import DeviceManager
from controller.songManager import SongManager
from model.exceptions import FolderException
import os

class ConsoleView(object):
    """
    Class that encloses the operations to be performed whithout guy.
    """

    def __init__(self, src_list, tgt, id3 = None):
        """
        Initializes the attributes 'song_mgr', 'device_mgr'. 'src_list', 'tgt', 'id3'.
        
        @param src_list: list of paths of the source folders.
        @param tgt: path of the target folder.
        @param id3: Optional param to specify id3-based sorting  
        """
        self.song_mgr = SongManager()
        self.device_mgr = DeviceManager.get_device_manager()
        self.src_list = src_list
        self.tgt = tgt
        self.id3 = id3
        
    def run(self):
        """
        Execution loop of the class.
        """
        self.device_mgr.check_folder(self.tgt)
        wrong_src, ok_src = self.song_mgr.check_src_folders(self.src_list)
    #import getpass
    #password = getpass.getpass('Enter password:')